<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qdoc-manual-markupcmds.qdoc -->
  <title>Document Structure | QDoc Manual 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qdoc-index.html">QDoc Manual</a></td><td >Document Structure</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qdoc-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="04-qdoc-commands-textmarkup.html" />
  <link rel="next" href="06-qdoc-commands-includecodeinline.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="04-qdoc-commands-textmarkup.html">Text Markup</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="06-qdoc-commands-includecodeinline.html">Including Code Inline</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#section-commands">Section commands</a></li>
<li class="level1"><a href="#section1">\section1</a></li>
<li class="level1"><a href="#section2">\section2</a></li>
<li class="level1"><a href="#section3">\section3</a></li>
<li class="level1"><a href="#section4">\section4</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Document Structure</h1>
<span class="subtitle"></span>
<!-- $$$05-qdoc-commands-documentstructure.html-description -->
<div class="descr"> <a name="details"></a>
<p>The document structuring commands are for dividing your document into sections. QDoc supports four levels of section: <code>\section1</code>, <code>\section2</code>, <code>\section3</code>, and <code>\section4</code>. The section commands correspond to the traditional section, subsection, etc used in outlining.</p>
<a name="section-commands"></a><a name="section-commands"></a>
<h2 id="section-commands">Section commands</h2>
<p>In general a document structuring command considers everything that follows it until the first line break as its argument. The argument is rendered as the unit's title. If the title needs to be spanned over several lines, make sure that each line (except the last one) is ended with a backslash.</p>
<p>In total, there are four levels for sections in QDoc: <code>\section1</code>, <code>\section2</code>, <code>\section3</code> and <code>\section4</code>. These correspond to the traditional section, subsection, subsubsection and subsubsubsection.</p>
<p>There is a strict ordering of the section units:</p>
<pre class="cpp">

  section1
         <span class="operator">|</span>
         section2
                <span class="operator">|</span>
                section3
                       <span class="operator">|</span>
                       section4

</pre>
<p>When sections are used, the first section command should be <code>section1</code>.</p>
<pre class="cpp">

  <span class="operator">/</span> <span class="operator">*</span><span class="operator">!</span>
      \section1 Basic <span class="type"><a href="../qtcore/qt.html">Qt</a></span>

      This is the first section<span class="operator">.</span>


          \section2 Getting Started

          This is the first subsection<span class="operator">.</span>


              \section3 Hello <span class="type"><a href="../qtcore/qt.html">Qt</a></span>

              This is the first subsubsection<span class="operator">.</span>


              \section3 Making Connections

              This is the second subsubsection<span class="operator">.</span>


              \section3 Using the Reference Documentation

              This is the third subsubsection<span class="operator">.</span>


          \section2 Creating Dialogs

          This is the second subsection<span class="operator">.</span>


              \section3 Subclassing <span class="type"><a href="../qtwidgets/qdialog.html">QDialog</a></span>

              This is the first subsubsection<span class="operator">.</span>

              <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>


      \section1 Intermediate <span class="type"><a href="../qtcore/qt.html">Qt</a></span>

      This is the second section<span class="operator">.</span>


          \section2 Layout Management

          This is the second section<span class="char">'s first subsection.


              \section3 Basic Layouts

              This is the first subsubsection.

      ...
  * /
  </span>

</pre>
<p>QDoc renders this as:</p>
<blockquote>               <a name="Basic Qt">
               <h1>Basic Qt</h1>
               </a>
               <p>This is the first section.</p>

                   <a name="Getting started">
                   <h2>Getting Started</h2>
                   </a>
                   This is the first subsection.</p>

                       <a name="Hello Qt">
                       <h3>Hello Qt</h3>
                       </a>
                       <p>This is the first subsubsection.</p>

                       <a name="Making Connections">
                       <h3>Making Connections</h3>
                       </a>
                       <p>This is the second subsubsection.</p>

                       <a name="Using the Reference Documentation">
                       <h3>Using the Reference Documentation</h3>
                       </a>
                       <p>This is the third subsubsection.</p>

                   <a name="Creating Dialogs">
                   <h2>Creating Dialogs</h2>
                   </a>
                   <p>This is the second subsection.</p>

                       <a name="Subclassing QDialog">
                       <h3>Subclassing QDialog</h3>
                       </a>
                       <p>This is the first subsubsection.</p>

                       ...

               <a name="Intermediate Qt">
               <h1>Intermediate Qt</h1>
               </a>
               <p>This is the second section.</p>

                   <a name="Layout Management">
                   <h2>Layout Management</h2>
                   </a>
                   <p>This is the second section's first subsection.</p>

                       <a name="Basic Layouts">
                       <h3>Basic Layouts</h3>
                       </a>
                       <p>This is the first subsubsection.</p>

               ...

           </blockquote>
<p>Each section is a logical unit in the document. The section heading appears in the automatically generated table of contents that normally appears in the upper right-hand corner of the page.</p>
<a name="sectionone-command"></a><a name="section1"></a>
<h2 id="section1">\section1</h2>
<p>The \section1 command starts a new section.</p>
<p>See <a href="05-qdoc-commands-documentstructure.html#section-commands">Section commands</a> for an explanation of the various section units, command argument, and rendering.</p>
<a name="sectiontwo-command"></a><a name="section2"></a>
<h2 id="section2">\section2</h2>
<p>The \section2 command starts a new section.</p>
<p>See <a href="05-qdoc-commands-documentstructure.html#section-commands">Section commands</a> for an explanation of the various section units, command argument, and rendering.</p>
<a name="sectionthree-command"></a><a name="section3"></a>
<h2 id="section3">\section3</h2>
<p>The \section3 command starts a new section.</p>
<p>See <a href="05-qdoc-commands-documentstructure.html#section-commands">Section commands</a> for an explanation of the various section units, command argument, and rendering.</p>
<a name="sectionfour-command"></a><a name="section4"></a>
<h2 id="section4">\section4</h2>
<p>The \section4 command starts a new section.</p>
<p>See <a href="05-qdoc-commands-documentstructure.html#section-commands">Section commands</a> for an explanation of the various section units, command argument, and rendering.</p>
</div>
<!-- @@@05-qdoc-commands-documentstructure.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="04-qdoc-commands-textmarkup.html">Text Markup</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="06-qdoc-commands-includecodeinline.html">Including Code Inline</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
